import random
from unicodedata import name
file=open("all.txt","r",encoding="utf-8")
all=file.read()
namelist=all.split('\n')
sum=len(namelist)
order=0
remain=0
print("计科1813和1814班总人数:%d"%sum)
name=random.choice(namelist)
namelist.remove(name)
print("随机点名开始：")
print("点中了：%s同学"%name)
order+=1
remain=sum-order
print("已随机点名人数：%d,未点名人数：%d"%(order,remain))
f=open("新名单.txt","w",encoding="utf-8")
for line in namelist:
     f.write(line+'\n')
f.close
